chore(via-btc-client): expose concrete RPC method names in retry metrics#346
Open
chore(via-btc-client): expose concrete RPC method names in retry metrics#346
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the BitcoinRpcClient in rpc_client.rs to include an operation_name parameter in the retry_rpc method. This change allows for more descriptive logging or monitoring by passing a specific string identifier (e.g., "get_block_count", "send_raw_transaction") to the underlying with_retry function. All internal calls to retry_rpc have been updated to provide these identifiers. I have no feedback to provide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This observability-only PR changes the Bitcoin RPC retry wrapper to label retries / max-retry metrics with the concrete RPC method name instead of the generic
RPC calllabel.Why
During Via main testnet
via-l1-indexerinvestigation, the live metric exposed only:via_btc_client_rpc_max_retries_exceeded{method="RPC call"}That made it impossible to tell which exact Bitcoin Core RPC method was timing out from production metrics alone.
This PR keeps behavior unchanged and only improves operator visibility by emitting concrete method names such as:
get_block_countget_block_by_heightget_block_statsget_raw_transactionget_raw_transaction_infoScope
Incident context
This came out of a Via main testnet investigation where:
via-l1-indexerrepeatedly logged transport timeouts to the Bitcoin RPC serviceThis PR is intended to make the next live incident materially easier to localize.